<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <meta charset="UTF-8">
        <title>树上</title>
        <script src="Public/JqPlugin/jquery-1.11.3.min.js" type="text/javascript"></script>
        <script src="Public/JqPlugin/kindeditor-4.1.10/kindeditor-min.js" type="text/javascript"></script>
    </head>
    <body>
    <form method="post">
        <div><button type="submit" id="btn-fix">修复内容</button></div>
        <div><textarea name="content" rows="21" cols="180"></textarea></div>
        <div><button type="submit" id="btn-fix">修复内容</button></div>
        <input type="hidden" name="action" value="run" />
        </form>
        <div style="max-height:300px;max-width:800px;overflow-y:auto;" id="out-div">
            <!--内容开始-->
        <?php
        if(I('action')=='run'){
            $content=I('content');
            $content=  str_replace('style="padding: 0px; margin: 0px 0px 15px; color: #2b2b2b; font-family: Arial, Verdana, 宋体, 微软雅黑; font-size: 14px; line-height: 22px; text-indent: 28px; background-color: #ffffff;"', '',$content);
            $content=  str_replace('style="padding: 0px; margin: 0px;"', '',$content);
            $content=  str_replace('padding: 0px; margin: 0px; ', '',$content);
            $content=  str_replace(' vertical-align: text-bottom;', '',$content);
            $content=  str_replace('<bac ', '<span ',$content);
            $content=  str_replace('</bac>', '</span>',$content);
            echo $content;
        }
        function I($name,$defv=''){
            if(isset($_POST[$name])){
                return $_POST[$name];
            }else if(isset($_GET[$name])){
                return $_GET[$name];
            }else{
                return $defv;
            }
        }
        ?>
            <!--内容结束-->
            </div>
        <script type="text/javascript">
            var editor;
            KindEditor.ready(function (K) {
                editor = K.create('textarea[name="content"]', {
                    resizeType: 1,
                    allowPreviewEmoticons: false,
                    allowImageUpload: false,
                    items: ['source', 'preview', 'fullscreen']
                });
            });
        </script>
    </body>
</html>
